RangeFrom Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Returns a collection that can be used for enumerating some of the keys and values in the collection. Only keys that are greater than (and optionally, equal to) from are included. The keys are enumerated in sorted order. Keys equal to from can be included or excluded depending on the fromInclusive parameter.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public OrderedMultiDictionary<TKey, TValue>.OrderedMultiDictionary<(Of <TKey, TValue>)>..::View RangeFrom(
	TKey from,
	bool fromInclusive
)
Visual Basic (Declaration)
Public Function RangeFrom ( _
	from As TKey, _
	fromInclusive As Boolean _
) As OrderedMultiDictionary<(Of <TKey, TValue>)>..::View
Visual C++
public:
OrderedMultiDictionary<(Of <TKey, TValue>)>..::View^ RangeFrom (
	TKey from, 
	bool fromInclusive
)

Parameters

from
TKey
The lower bound of the range.
fromInclusive
Boolean
If true, the lower bound is inclusive--keys equal to the lower bound will be included in the range. If false, the lower bound is exclusive--keys equal to the lower bound will not be included in the range.

Return Value

An OrderedMultiDictionary.View of key-value pairs in the given range.

Remarks

The sorted order of the keys is determined by the comparison instance or delegate used to create the dictionary.

Typically, this property is used in conjunction with a foreach statement. For example:

 Copy imageCopy Code
             foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, true)) {
                // process pair
             }
            

Calling RangeFrom does not copy of the data in the dictionary, and the operation takes constant time.

See Also